<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function createObj() {
        if (true) {
          return class {
            constructor() {
              this.username = "jack";
            }
            say() {
              console.log("hello jack");
            }
          };
        }
      }
      const Person = createObj();
      const p1 = new Person();
      const p2 = new Person();
      console.log(p1.say === p2.say);
    </script>
  </body>
</html>
